package youcheng.work.view_zhexian;

import android.content.Intent;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

public class LogoActivity extends AppCompatActivity {
    int Count = 3;
    Timer timerout;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_logo);
        this.setTitle("欢迎使用");

        /* 定时任务每间隔1000ms run 一次 conut=3 运行3次后也就是 3s 后跳到下一个页面视图*/
        timerout = new Timer(1000, new Runnable() {
            @Override
            public void run() {
                Count--;
                //mSendButton.setText("进入应用　　" + Count);
                if(Count == 0){
                    Intent intent = new Intent();
                    intent.setClass(LogoActivity.this, LoginActivity.class);
                    startActivity(intent);
                    timerout.stop();
                    LogoActivity.this.finish();

                }
            }
        });
        timerout.restart();
    }
    @Override
    protected void onDestroy() {
        // TODO Auto-generated method stub
        super.onDestroy();
        timerout.stop();

    }
}